import React, { Component } from 'react'
// 使用非受控组件,获取真实dom
// 1. 创建ref对象
const xxxRef = React.createRef()
export default class App extends Component {
  render() {
    return (
      <div>
        {/* 2.在指定标签上绑定ref对象 */}
        <input type="text" ref={xxxRef} />
        <button
          onClick={() => {
            // 3. 获取
            console.log(xxxRef.current)
          }}
        >
          按钮
        </button>
      </div>
    )
  }
}
